﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Web.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewBag.Message = "Homepage.";
            if (!Enring.EnringContext.Current.HasLogin())
            {
                //Enring.EnringContext.Current.Login("user1", "user1", true);
                return RedirectToAction("Login", "Account");
            }
            else
            {
                ViewData["UserName"] = Enring.EnringContext.Current.CurrentUser.Name;
            }
            return View();
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your app description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}
